<?php
mb_internal_encoding ( "UTF-8" );
header ( 'Content-Type: text/html; charset=UTF-8' );

$canciones = array (
		"Let it be",
		"Mediterraneo",
		"Close to the edge",
		"Bohemian rhapsody" 
);

$peliculas = array (
		"Titanic",
		"Crepúsculo",
		"Los juegos del hambre" 
);

$info = $_REQUEST ['dato'];

if ($info == "cancion") {
	$aleatorio = rand ( 0, (count ( $canciones ) - 1) );
	$cancion = $canciones [$aleatorio];
	echo $cancion;
} else if ($info == "pelicula") {
	$aleatorio = rand ( 0, (count ( $peliculas ) - 1) );
	$pelicula = $peliculas [$aleatorio];
	echo $pelicula;
}

?>